<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      template="./template.xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      >

    <title>Alta de Libros</title>
    <meta name="viewport" content="width=device-width"/>

    <body>
        <h:form id="form2">
            <p:menubar>
                <p:submenu label="Registros" icon="ui-icon-document">
                    <p:menuitem><h:link value="Home" outcome="index"/></p:menuitem>
                    <p:menuitem><p:commandLink value="Borrar" action="#{accescontrol.AccesoBorrar()}"/></p:menuitem>
                </p:submenu>
            </p:menubar>
        </h:form>
        <h:form>
            <h:panelGrid columns="2" cellpadding="5">
                <p:outputLabel for="Id_Libro" value="Id_Libro: " />
                <h:inputText id="Id_Libro" value="#{customer.idLibro}" />

                <p:outputLabel for="titulo" value="Titulo: " />
                <h:inputText id="titulo" value="#{customer.titulo}" />

                <p:outputLabel for="autor" value="Autor:" />
                <h:inputText id="autor" value="#{customer.autor}"/>  
                <p:commandButton value="Guardar" actionListener="#{customer.Salvar()}" update="display" oncomplete="PF('dlg').show()"/>
                <outputLabel Value="HOME" url="./index.xhtml"/>

            </h:panelGrid>


            <p:dialog widgetVar="dlg" modal="true" resizable="false" header="Altas" showEffect="fade">
                <p:panelGrid id="display" columns="2" columnClasses="label,value">
                    <h:outputText value="ID: " />
                    <h:outputText id="idLibroValue" value="#{customer.idLibro}" />

                    <h:outputText value="titulo: " />
                    <h:outputText id="tituloValue" value="#{customer.titulo}" />

                    <h:outputText value="autor: " />
                    <h:outputText id="ActorValue" value="#{customer.autor}"/>
                </p:panelGrid>
                
            </p:dialog>
        </h:form>
    </body>
</html>
